import { LocalList } from "../local/LocalList";
import LocalValue from "../local/LocalValue";
import LocalMap from "../local/LocalMap";
import { IDataManager } from "./IDataManager";
import { IMap } from "./IMap";
import { IList } from "./IList";
import { IValue } from "./IValue";
export class LocalManager {


    protected dataMgr: IDataManager

    constructor(dataMgr: IDataManager) {
        this.dataMgr = dataMgr
    }


    getLocalList<T>(name: string, def: T[]): IList<T> {
        return new LocalList(this.getLocalValue(name, def))
    }

    getLocalMap<T>(name: string, def: { [key: string]: T }): IMap<T> {
        return new LocalMap(this.getLocalValue(name, def))
    }

    getLocalValue<T>(name: string, def: T): IValue<T> {
        return new LocalValue(this.dataMgr, name, def)
    }


}